Passed
Push — master ( c84e5c...0e0008 )
by philippe
04:14
created

functions.js ➔ equalsHeightOf   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 5
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 2
1
function loadJSON(filename, callback) {
2
3
    var xobj = new XMLHttpRequest();
4
    xobj.overrideMimeType("application/json");
5
    xobj.open('GET', filename, true);
6
    xobj.onreadystatechange = function () {
7
        if (xobj.readyState == 4 && xobj.status == "200") {
8
            // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode
9
            callback(xobj.responseText);
10
        }
11
    };
12
    xobj.send(null);
13
}
14
15
16
function equalsHeightOf(node1, node2) {
17
    var w1 = node1.style.height;
18
    node2.style.height = w1 + 'px';
19
20
}